package com.example.demo.quartz;


import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;

/**
 * @author: XuPengfei
 * @data: 2020/7/10 22 59
 * @description:
 */
//@RestController
//@RequestMapping("/test")
//@Api(tags = "时间测试")
//@Slf4j
public class TestController {
    /**
     * @Description:
     * @Param: * @param null
     * @return:
     * @Author: xpf
     * @date: 2020/7/10
     */
    @PostMapping("addquartz")
    @ApiOperation(value = "新增定时任务 xpf")
    public void addQuartz(@RequestBody String requestData, HttpServletRequest request) {
        Map<String, Object> map = new HashMap<>();
        map.put("sss", requestData);
        try {
            QuartzManager.getInstance().addJob(TestTask.class, "test1", "test", "00 20 23 10 7 ? 2020", map);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
